package com.example.demo.prop;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/")
@PropertySource(value = {"classpath:/test.properties"})
public class PropTest {
    @Value("${test.key}")
    private String testKey;

    @RequestMapping("test")
    public String test(){
        System.out.println(testKey);
        return testKey;
    }
}
